package com.etheart.music.web.action.usersphere.helper;

import java.util.Map;

import com.etheart.model.entity.User;

public class UsersphereHelper {
	public  static Long getUseridFromSession(Map<String, Object> session){
		return (Long) session.get("userid");
	}
	public  static Long getUsernameFromSession(Map<String, Object> session){
		return (Long) session.get("username");
	}
	public  static void setUseridFromSession(Map<String, Object> session,Long userid){
		 session.put("userid", userid);
	}  
	 
	public static void loginSession(Map<String, Object> session,User user) {
		session.put("userid", user.getId());
		session.put("username", user.getUsername());
	}
}
